A digital image is made up of a fixed number of pixels, typically in a rectangular array having a specified number of rows and columns. Each pixel is associated with pixel data that specifies visual characteristics for that pixel, such as color, luminosity, hue, or saturation. These visual characteristics define the content of the digital image. For example, FIG. 1a shows a sample digital image 100 that includes a dark triangle 120 on a light background 110. A magnified view of a portion A of the diagonal edge of triangle 120 is shown in FIG. 1b, revealing the rectangular array (rows and columns) of pixels forming digital image 100. Background 110 is formed by a plurality of light pixels 111, while triangle 120 is formed by a plurality of dark pixels 121. Note that pixels 111 and 121 are not intrinsically different, but only differ in their assigned pixel data. Therefore, modification of digital image 100 simply involves changing the pixel data associated with pixels 111 and 121.
When upscaling (i.e., enlarging or scaling up) a digital image, such as digital image 100, the original pixels cannot simply be copied into more widely spaced positions. Such an approach would produce a washed out image due to the inter-pixel gaps formed by the increased spacing. Therefore, an interpolation process is required to generate new pixels that fill the gaps in the enlarged image. Typically, it is desirable that the final enlarged image visually resembles the original digital image, so it is critical that the interpolation process minimize any visual distortion. At the same time, the interpolation process should not be so complex that it consumes an excessive amount of computational resources. Any digital image scaling process must carefully balance these two concerns.
For example, a digital image scaling process could simply involve replacing each of the original pixels with an appropriate number of “duplicate” pixels—e.g., a 400% enlargement would mean that each of the original pixels would be replaced by four duplicate pixels. Each duplicate pixel would be a copy of its associated original pixel, so very little computational effort would be required for such an interpolation process. Unfortunately, this type of “direct enlarging” can produce images full of jagged edges and other aesthetically displeasing effects. In particular, diagonal lines experience significant distortion from this type of scaling process, since the enlarged “pixels” create distinct stair-step patterns. For example, FIG. 2 shows a digital image 200 that could be generated from digital image 100 (shown in FIG. 1a) using a direct enlargement technique. Digital image 200 includes a dark scaled triangle 220 on a light background 110. Triangle 220 includes an extremely jagged diagonal edge 221 that results from direct enlargement of the pixels in the original image. This jagged edge significantly detracts from the visual quality of digital image 200.
To reduce the laddering effect shown in FIG. 2, a bilinear interpolation process is often used to generate the pixels for a scaled image. Typically, a scaling operation using bilinear interpolation is performed in a frame of reference matching the orthogonal axes of the pixel array, and can therefore be termed “rectangular bilinear scaling” or “standard bilinear scaling.” In a rectangular bilinear scaling process, a “pixel set” of four pixels surrounding the output pixel (interpolated pixel) is used to calculate the scaled pixel data for the output pixel. Since the rectangular bilinear scaling process is aligned with the horizontal and vertical axes of the pixel array, the pixel set forms a square.
For example, FIG. 3 shows a pixel array 300 that includes original pixels A1–A5, B1–B5, C1––C5, D1–D5, and E1–E5. In preparation for a rectangular bilinear scaling procedure, a pixel set 310 is defined to include the four original pixels (pixels B2, B3, C2, and C3) that surround output pixel R1. The location of output pixel R1 relative to pixels B2, B3, C2, and C3, as indicated by offsets p and q. The original pixel data of each of these original pixels can then be weighted according to that pixel's distance from output pixel R1, and then averaged to obtain the scaled pixel data for output pixel R1. Specifically, the scaled pixel data for output pixel R1 can be calculated. A standard bilinear interpolation function as described by the following formula:
                              V          ⁡                      (            scaled            )                          =                                            [                                                                                          1                      -                      q                                                                            q                                                              ]                        ⁡                          [                                                                    B2                                                        B3                                                                                        C2                                                        C3                                                              ]                                ⁡                      [                                                                                1                    -                    p                                                                                                p                                                      ]                                              (        a        )            
By using the bilinear interpolation function of equation (a), some of the harsh distortions and laddering associated with direct enlargement techniques can be avoided since edge transitions are smoothed out and given a more gradual transition.
For example, FIG. 4 shows a digital image 400 that could be generated from digital image 100 (shown in FIG. 1a) using bilinear scaling. Digital image 400 includes a dark scaled triangle 420 on a light background 110. Unlike triangle 220 shown in FIG. 2, triangle 420 is not a monolithic shape, but instead includes transition regions 421, 422, and 423 along its perimeter. Transition regions 421–423 are formed by the rectangular bilinear scaling process used to produce scaled triangle 420, and provide a gradual transition from the dark pixels in the interior of triangle 420 to the light pixels of background 110. This transition between regions results in a softening of any enlarged edges, thereby enhancing the overall visual quality of the enlarged image. However, note that the diagonal edge of triangle 420, while less jagged than the diagonal edge of triangle 220 shown in FIG. 2, still exhibits significant stair-stepping. This is in large part due to the fact that rectangular bilinear scaling is optimized for orthogonal (i.e., horizontal or vertical) edges, since the frame of reference used in the interpolation process is parallel to the horizontal and vertical axes of the pixel array. Features that deviate from these orthogonal axes, such as diagonal edges, are not handled as well by the rectangular bilinear scaling process. As a result, horizontal transition region 421 and vertical transition region 422 form clean transitional edges, while diagonal transition region 423 exhibits the problematic laddering common to conventional scaling techniques. Hence, there is a need for a method and system for improving the visual quality of diagonal edges in upscaled digital images.